@file:Suppress("UNCHECKED_CAST", "USELESS_CAST", "INAPPLICABLE_JVM_NAME", "UNUSED_ANONYMOUS_PARAMETER", "NAME_SHADOWING", "UNNECESSARY_NOT_NULL_ASSERTION")
package uni.UNIF42C880
import io.dcloud.uniapp.*
import io.dcloud.uniapp.extapi.*
import io.dcloud.uniapp.framework.*
import io.dcloud.uniapp.runtime.*
import io.dcloud.uniapp.vue.*
import io.dcloud.uniapp.vue.shared.*
import io.dcloud.uts.*
import io.dcloud.uts.Map
import io.dcloud.uts.Set
import io.dcloud.uts.UTSAndroid
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Deferred
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.async
open class GenPagesEditEdit : BasePage {
    constructor(__ins: ComponentInternalInstance, __renderer: String?) : super(__ins, __renderer) {
        onLoad(fun(options: OnLoadOptions) {}, __ins)
    }
    @Suppress("UNUSED_PARAMETER", "UNUSED_VARIABLE")
    override fun `$render`(): Any? {
        val _ctx = this
        val _cache = this.`$`.renderCache
        return createElementVNode("view", utsMapOf("class" to "edit-container"), utsArrayOf(
            createElementVNode("view", utsMapOf("class" to "image-preview"), utsArrayOf(
                createElementVNode("text", utsMapOf("class" to "title-text"), "参考图"),
                createElementVNode("image", utsMapOf("src" to _ctx.imagePath, "mode" to "aspectFit", "class" to "preview-image"), null, 8, utsArrayOf(
                    "src"
                ))
            )),
            createElementVNode("view", utsMapOf("class" to "settings-panel"), utsArrayOf(
                createElementVNode("view", utsMapOf("class" to "panel-title"), utsArrayOf(
                    createElementVNode("text", null, "生成参数")
                )),
                createElementVNode("view", utsMapOf("class" to "generate-btn-container"), utsArrayOf(
                    createElementVNode("button", utsMapOf("class" to "generate-btn", "onClick" to _ctx.generateImage), "开始生成", 8, utsArrayOf(
                        "onClick"
                    ))
                ))
            ))
        ))
    }
    open var imagePath: String by `$data`
    open var selectedStyle: UTSArray<Number> by `$data`
    open var types: Any? by `$data`
    open var styles: Any? by `$data`
    open var skytype: Any? by `$data`
    open var background: Any? by `$data`
    open var buildingstyles: Any? by `$data`
    open var buildingfunctions: Any? by `$data`
    open var foreground: Any? by `$data`
    open var comfyUIServer: String by `$data`
    @Suppress("USELESS_CAST")
    override fun data(): Map<String, Any?> {
        return utsMapOf("imagePath" to "", "selectedStyle" to utsArrayOf(
            0,
            0,
            0,
            0,
            0,
            0,
            0
        ), "types" to `default`["type"], "styles" to `default`["styles"], "skytype" to `default`["skytype"], "background" to `default`["background"], "buildingstyles" to `default`["buildingstyles"], "buildingfunctions" to `default`["buildingfunctions"], "foreground" to `default`["foreground"], "comfyUIServer" to "http://172.30.204.42:8193/")
    }
    open var selectStyle = ::gen_selectStyle_fn
    open fun gen_selectStyle_fn(categoryIndex: Number, itemIndex: Number) {
        this.selectedStyle[categoryIndex] = itemIndex
        console.log("\u5DF2\u9009\u62E9: \u7C7B\u522B" + categoryIndex + ", \u9009\u9879" + itemIndex)
    }
    open var generateImage = ::gen_generateImage_fn
    open fun gen_generateImage_fn() {
        val params: UTSJSONObject = let {
            object : UTSJSONObject() {
                var positivePrompt = it.buildPositivePrompt()
                var steps: Number = 5
                var seed = Math.floor(Math.random() * 1000000000)
            }
        }
        console.log(this.imagePath)
    }
    open var buildPositivePrompt = ::gen_buildPositivePrompt_fn
    open fun gen_buildPositivePrompt_fn(): String {
        var prompt = ""
        return prompt
    }
    companion object {
        val styles: Map<String, Map<String, Map<String, Any>>> by lazy {
            normalizeCssStyles(utsArrayOf(
                styles0
            ), utsArrayOf(
                GenApp.styles
            ))
        }
        val styles0: Map<String, Map<String, Map<String, Any>>>
            get() {
                return utsMapOf("edit-container" to padStyleMapOf(utsMapOf("backgroundColor" to "#f5f5f5", "height" to "100%", "display" to "flex", "flexDirection" to "column")), "image-preview" to padStyleMapOf(utsMapOf("width" to "100%", "height" to 320, "backgroundColor" to "#000000", "display" to "flex")), "title-text" to padStyleMapOf(utsMapOf("color" to "#ffffff", "textAlign" to "center", "marginTop" to 10)), "preview-image" to padStyleMapOf(utsMapOf("width" to "100%")), "settings-panel" to padStyleMapOf(utsMapOf("flex" to 1, "paddingTop" to 15, "paddingRight" to 15, "paddingBottom" to 15, "paddingLeft" to 15, "backgroundColor" to "#ffffff", "borderTopLeftRadius" to 20, "borderTopRightRadius" to 20, "marginTop" to -20)), "panel-title" to padStyleMapOf(utsMapOf("marginBottom" to 15)), "setting-item" to padStyleMapOf(utsMapOf("marginBottom" to 10, "display" to "flex", "flexDirection" to "row")), "style-scroll" to padStyleMapOf(utsMapOf("display" to "flex", "flexDirection" to "column", "overflowX" to "auto")), "style-list" to padStyleMapOf(utsMapOf("width" to "auto", "flexDirection" to "row", "alignItems" to "center", "justifyContent" to "flex-end", "backgroundColor" to "#f0f0f0", "borderTopLeftRadius" to 15, "borderTopRightRadius" to 15, "borderBottomRightRadius" to 15, "borderBottomLeftRadius" to 15, "overflow" to "hidden", "flexWrap" to "nowrap", "borderTopWidth" to 1, "borderRightWidth" to 1, "borderBottomWidth" to 1, "borderLeftWidth" to 1, "borderTopStyle" to "solid", "borderRightStyle" to "solid", "borderBottomStyle" to "solid", "borderLeftStyle" to "solid", "borderTopColor" to "#e0e0e0", "borderRightColor" to "#e0e0e0", "borderBottomColor" to "#e0e0e0", "borderLeftColor" to "#e0e0e0")), "style-item" to utsMapOf("" to utsMapOf("flexShrink" to 0, "marginLeft" to 0, "paddingTop" to 0, "paddingRight" to 10, "paddingBottom" to 0, "paddingLeft" to 10, "height" to 30, "lineHeight" to "30px", "fontSize" to 12, "color" to "#333333", "backgroundColor" to "#d0d0d0", "borderTopLeftRadius" to 0, "borderTopRightRadius" to 0, "borderBottomRightRadius" to 0, "borderBottomLeftRadius" to 0, "borderTopWidth" to "medium", "borderRightWidth" to 1, "borderBottomWidth" to "medium", "borderLeftWidth" to "medium", "borderTopStyle" to "none", "borderRightStyle" to "solid", "borderBottomStyle" to "none", "borderLeftStyle" to "none", "borderTopColor" to "#000000", "borderRightColor" to "#e0e0e0", "borderBottomColor" to "#000000", "borderLeftColor" to "#000000", "borderRightWidth:last-child" to "medium", "borderRightStyle:last-child" to "none", "borderRightColor:last-child" to "#000000"), ".active" to utsMapOf("borderTopWidth" to 1, "borderRightWidth" to 1, "borderBottomWidth" to 1, "borderLeftWidth" to 1, "borderTopStyle" to "solid", "borderRightStyle" to "solid", "borderBottomStyle" to "solid", "borderLeftStyle" to "solid", "borderTopColor" to "#d0d0d0", "borderRightColor" to "#d0d0d0", "borderBottomColor" to "#d0d0d0", "borderLeftColor" to "#d0d0d0", "!backgroundColor" to "#e0e0e0", "!color" to "#333333")), "style-item-text" to utsMapOf("" to utsMapOf("marginLeft" to 0, "paddingTop" to 0, "paddingRight" to 10, "paddingBottom" to 0, "paddingLeft" to 10, "height" to 30, "lineHeight" to "30px", "fontSize" to 14, "color" to "#333333", "transitionDuration" to "0.3s"), ".active" to utsMapOf("color" to "#007AFF", "fontWeight" to "bold")), "generate-btn-container" to padStyleMapOf(utsMapOf("marginTop" to 30)), "generate-btn" to padStyleMapOf(utsMapOf("width" to "100%", "height" to 50, "backgroundColor" to "#007AFF", "color" to "#ffffff", "borderTopLeftRadius" to 25, "borderTopRightRadius" to 25, "borderBottomRightRadius" to 25, "borderBottomLeftRadius" to 25, "fontSize" to 18, "fontWeight" to "bold")), "@TRANSITION" to utsMapOf("style-item-text" to utsMapOf("duration" to "0.3s")))
            }
        var inheritAttrs = true
        var inject: Map<String, Map<String, Any?>> = utsMapOf()
        var emits: Map<String, Any?> = utsMapOf()
        var props = normalizePropsOptions(utsMapOf())
        var propsNeedCastKeys: UTSArray<String> = utsArrayOf()
        var components: Map<String, CreateVueComponent> = utsMapOf()
    }
}
